<include file="Public/Header" />

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- operation start -->
		<div class="am-g">
			<button class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus submit-add" data-am-modal="{target: '#power-save-win'}"> {{:L('common_operation_add')}}</button>
		</div>
		<!-- operation end -->

		<!-- save win start -->
		<div class="am-popup am-radius" id="power-save-win">
			<div class="am-popup-inner">
				<div class="am-popup-hd">
					<h4 class="am-popup-title" data-add-title="{{:L('power_add_name')}}" data-edit-title="{{:L('power_edit_name')}}">{{:L('power_add_name')}}</h4>
					<span data-am-modal-close class="am-close">&times;</span>
				</div>
				<div class="am-popup-bd">
					<!-- form start -->
					<form class="am-form form-validation admin-save" action="{{:U('Admin/Power/PowerSave')}}" method="POST" request-type="ajax-reload" request-value="">
						<div class="am-form-group">
							<label>{{:L('power_level_text')}}</label>
							<select  class="am-radius c-p" name="pid" data-validation-message="{{:L('power_level_format')}}">
								<option value="0">{{:L('common_select_level_one_choice')}}</option>
								<foreach name="list" item="v">
									<option value="{{$v.id}}">{{$v.name}}</option>
								</foreach>
							</select>
						</div>
						<div class="am-form-group">
							<label>{{:L('power_name_text')}}</label>
							<input type="text" placeholder="{{:L('power_name_text')}}" name="name" minlength="2" maxlength="16" data-validation-message="{{:L('power_name_format')}}" class="am-radius" required />
						</div>
						<div class="am-form-group">
							<label>{{:L('power_control_text')}}</label>
							<input type="text" placeholder="{{:L('power_control_text')}}" name="control" pattern="{{:L('common_regex_control')}}"  data-validation-message="{{:L('power_control_format')}}" class="am-radius" required />
						</div>
						<div class="am-form-group">
							<label>{{:L('power_action_text')}}</label>
							<input type="text" placeholder="{{:L('power_action_text')}}" name="action" pattern="{{:L('common_regex_action')}}"  data-validation-message="{{:L('power_action_format')}}" class="am-radius" required />
						</div>
						<div class="am-form-group">
							<label>{{:L('power_icon_text')}}<span class="fs-12 fw-100 cr-999">（{{:L('power_icon_tips')}}）</span></label>
							<input type="text" placeholder="{{:L('power_icon_text')}}" name="icon" maxlength="60" data-validation-message="{{:L('power_icon_format')}}" class="am-radius" />
						</div>
						<div class="am-form-group">
							<label>{{:L('common_view_sort_title')}}</label>
							<input type="number" placeholder="{{:L('common_view_sort_title')}}" name="sort" min="0" max="255" data-validation-message="{{:L('common_sort_error')}}" class="am-radius" value="0" required />
						</div>
						<include file="Lib/IsShow" />
						<div class="am-form-group">
							<input type="hidden" name="id" />
							<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
						</div>
					</form>
					<!-- form end -->
				</div>
			</div>
		</div>
		<!-- save win end -->

        <!-- content start -->
		<ul class="tree-list p-0 m-t-15">
			<foreach name="list" item="v">
				<li id="data-list-{{$v.id}}" <if condition="$v['is_show'] eq 0">class="bk-cr-ffd"</if>>
					<if condition="!empty($v['item'])">
						<i class="am-icon-plus c-p m-r-5"></i>
						<label class="c-p">
					<else />
						<label class="c-p m-l-20">
					</if>
						<span><if condition="!empty($v['icon'])"><span class="{{$v.icon}}"></span></if> {{$v.name}}</span>
					</label>
					<div class="fr m-r-20 list-submit">
						<span class="am-icon-edit am-icon-md c-p submit-edit <if condition="!empty($v['item'])">m-r-5</if>" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}" data-am-modal="{target: '#power-save-win'}" data-json='{{:json_encode($v)}}' data-tag="power-save-win" data-item="<if condition="!empty($v['item'])">ok<else />no</if>"></span>
						<if condition="empty($v['item'])">
							<span class="am-icon-trash-o am-icon-md c-p m-l-20 m-r-15 submit-delete" data-url="{{:U('Admin/Power/PowerDelete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></span>
						</if>
					</div>
				</li>
				<if condition="!empty($v['item'])">
					<ul class="list-find p-0 m-t-5" style="display:none;">
						<foreach name="v.item" item="vs">
							<li id="data-list-{{$vs.id}}" <if condition="$vs['is_show'] eq 0">class="bk-cr-ffd"</if>>
								<label class="c-p">
									<span><if condition="!empty($vs['icon'])"><span class="{{$vs.icon}}"></span></if> {{$vs.name}}</span>
								</label>
								<div class="fr m-r-20 find-submit">
									<span class="am-icon-edit am-icon-md c-p submit-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}" data-am-modal="{target: '#power-save-win'}" data-json='{{:json_encode($vs)}}' data-tag="power-save-win" data-item="no"></span>
									<span class="am-icon-trash-o am-icon-md c-p m-l-20 m-r-15 submit-delete" data-url="{{:U('Admin/Power/PowerDelete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$vs.id}}"></span>
								</div>
							</li>
						</foreach>
					</ul>
				</if>
			</foreach>
		</ul>
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
<include file="Public/Footer" />
<!-- footer end -->